ns16550: mask transmit holding register empty interrupt when tx is stopped
authorChris Patterson <pattersonc@ainfosec.com>
Thu, 25 Aug 2016 07:00:59 +0000 (09:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 25 Aug 2016 07:00:59 +0000 (09:00 +0200)
commitb42a30f3f90370828e68fa5324d561d0b2df9ef9
treef0f07096c9109e550ed8bbc9c8aaff4b02752908
parentfb3cc1796201b249f5bee2b8b3583d279fb4d7cf
ns16550: mask transmit holding register empty interrupt when tx is stopped

The uart generates an interrupt whenever the transmit holding register is
empty and UART_IER_ETHREI is set in UART_IER.  Currently, Xen's ns16550
driver does not currently mask this interrupt when transmit is stopped,
unlike other platforms such as Linux [1].

Toggle UART_IER_ETHREI flag in the UART_IER according to the state dictated
by stop_tx and start_tx hooks.

On the Tegra platform (forthcoming series), the reset via reading IIR does not
prevent re-assertion of THRE.  This causes Xen to hang in the interrupt
handler's while loop whenever there is no data to transmit.  This behavior (bug?)
is addressed by utilizing the start & stop tx hooks.

This has been tested on various x86 PCs for any obvious signs of regressions.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/8250_port.c?id=refs/tags/v4.8-rc2#n1518

Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/char/ns16550.c